fetcher: Initialize output_stream_set_lock mutex
authorAlexander Larsson <alexl@redhat.com>
Wed, 13 Apr 2016 09:14:20 +0000 (11:14 +0200)
committerColin Walters (automation) <walters+githubbot@verbum.org>
Wed, 13 Apr 2016 14:11:46 +0000 (14:11 +0000)
ostree pull-local crashed for me in thread_closure_unref () doing:
    g_mutex_clear (&thread_closure->output_stream_set_lock);

Seems like we never initialize this mutex.

Closes: #254
Approved by: cgwalters

src/libostree/ostree-fetcher.c

index 26e72c452002cbb5d6cce1274127e0cc63c26f01..d7915ba69fdfaf5ae47f2ddf93a8d15fb4a9cf27 100644 (file)
@@ -541,6 +541,7 @@ _ostree_fetcher_constructed (GObject *object)
   self->thread_closure->output_stream_set = g_hash_table_new_full (NULL, NULL,
                                                                    (GDestroyNotify) NULL,
                                                                    (GDestroyNotify) g_object_unref);
+  g_mutex_init (&self->thread_closure->output_stream_set_lock);
 
   if (g_getenv ("OSTREE_DEBUG_HTTP"))
     {